import React, { Component } from "react";
// import {  Route, Link,NavLink } from "react-router-dom";
export default class About extends Component {
  render() {
    console.log(this.props.location); //pathname: "/about/shop_list/two"
    console.log(this.props.match);
    console.log(this.props.match.params);
    return (
      <div>
        <h2>商品详情</h2>
        <div>
          <ul>
            <li>访问的页面为{this.props.match.params.id}</li>
            <li>aaa</li>
            <li>bbb</li>
            <li>ccc</li>
            <li>ddd</li>
            <li>eee</li>
          </ul>
          <button
            onClick={() => {
              this.props.history.replace("/");
            }}
          >
            返回首页（this.props.history.replace('/')）
          </button>
          <button
            onClick={() => {
              this.props.history.push("/home");
            }}
          >
            进入Home(this.props.history.push('/home'))
          </button>
        </div>
      </div>
    );
  }
}
